/* Laboratorio # 2 - Administración de bases de datos
 Jorge Fallas Ramos         402090469
 José Roberto Sánchez       115400070
 Daniel Villalobos Venegas  402110100
 */
package monitorinitdb;

public class Build {

    private String DB_CREATE_FILE_DEST = "";
    private String database = "";
    private String logfiles = "";
    private String character = "character set WE8ISO8859P1";
    private String nationalCharacter = "national character set utf8";
    private String dataFile = "";
    private String sysaux_datafile = "";
    private String undo_tablespace = "";
    private String tablespaces = "";
    private String LOG_ARCHIVE_DEST_1 = "";
    private String alter_database_archivelog = "alter database archivelog;";
    private String LOG_ARCHIVE_TRACE = "";
    private String archive_lag_target = "";
    private String dataBaseMount = "";
    private String database_open = "";

    public Build(String DB_CREATE_FILE_DEST, String database, String logfiles,
            String dataFile, String sysaux_datafile, String undo_tablespace,
            String tablespaces, String LOG_ARCHIVE_DEST_1, String LOG_ARCHIVE_TRACE,
            String archive_lag_target, String dataBaseMount, String database_open, String ruta) {

        this.DB_CREATE_FILE_DEST = DB_CREATE_FILE_DEST;
        this.database = database;
        this.logfiles = logfiles;
        this.dataFile = dataFile;
        this.sysaux_datafile = sysaux_datafile;
        this.undo_tablespace = undo_tablespace;
        this.tablespaces = tablespaces;
        this.LOG_ARCHIVE_DEST_1 = LOG_ARCHIVE_DEST_1;
        this.LOG_ARCHIVE_TRACE = LOG_ARCHIVE_TRACE;
        this.archive_lag_target = archive_lag_target;
        this.dataBaseMount = dataBaseMount;
        this.database_open = database_open;
        creaBuild(ruta);
    }

    public void creaBuild(String ruta) {
        escritoraSQL escSQL = new escritoraSQL(ruta);
        escSQL.creaBuild(this, "build.sql");
    }

    public String getDB_CREATE_FILE_DEST() {
        return DB_CREATE_FILE_DEST;
    }

    public String getDatabase() {
        return database;
    }

    public String getLogfiles() {
        return logfiles;
    }

    public String getCharacter() {
        return character;
    }

    public String getNationalCharacter() {
        return nationalCharacter;
    }

    public String getDataFile() {
        return dataFile;
    }

    public String getSysaux_datafile() {
        return sysaux_datafile;
    }

    public String getUndo_tablespace() {
        return undo_tablespace;
    }

    public String getTablespaces() {
        return tablespaces;
    }

    public String getLOG_ARCHIVE_DEST_1() {
        return LOG_ARCHIVE_DEST_1;
    }

    public String getAlter_database_archivelog() {
        return alter_database_archivelog;
    }

    public String getLOG_ARCHIVE_TRACE() {
        return LOG_ARCHIVE_TRACE;
    }

    public String getArchive_lag_target() {
        return archive_lag_target;
    }

    public String getDataBaseMount() {
        return dataBaseMount;
    }

    public String getDatabase_open() {
        return database_open;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append(DB_CREATE_FILE_DEST).append("\n");
        b.append(database).append("\n");
        b.append(logfiles).append("\n");
        b.append(character).append("\n");
        b.append(nationalCharacter).append("\n");
        b.append(dataFile).append("\n");
        b.append(sysaux_datafile).append("\n");
        b.append(tablespaces).append("\n");
        b.append(LOG_ARCHIVE_DEST_1).append("\n");
        b.append(alter_database_archivelog).append("\n");
        b.append(LOG_ARCHIVE_TRACE).append("\n");
        b.append(archive_lag_target).append("\n");
        b.append(dataBaseMount).append("\n");
        b.append(database_open).append("\n");
        return b.toString();
    }
}
